/*
package com.shiku.payment.controller;

import com.shiku.payment.api.IPaymentNoticeApiService;
import com.shiku.payment.constant.PayConstant;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;

@RestController
@Slf4j
public class AliPayController {

    @Autowired
    private IPaymentNoticeApiService paymentNoticeService;


*
     * 支付宝移动支付后台通知响应
     * @param request
     * @return
     * @throws ServletException
     * @throws IOException


    @RequestMapping(value = "/notify/aliPayNotifyRes")
    @ResponseBody
    public String aliPayNotifyRes(HttpServletRequest request) throws ServletException, IOException {
        log.info("====== 开始接收支付宝支付回调通知 ======");
        String notifyRes = doAliPayRes(request);
        log.info("响应给支付宝:{}", notifyRes);
        log.info("====== 完成接收支付宝支付回调通知 ======");
        return notifyRes;
    }

    public String doAliPayRes(HttpServletRequest request) throws ServletException, IOException {
        String logPrefix = "【支付宝支付回调通知】";
        //获取支付宝POST过来反馈信息
        Map<String,String> params = new HashMap<String,String>();
        Map<String,String[]> requestParams = request.getParameterMap();


        for (Map.Entry<String, String[]> entry :requestParams.entrySet()) {
            String valueStr = "";
            for (int i = 0; i < entry.getValue().length; i++) {
                valueStr = (i == entry.getValue().length - 1) ? valueStr + entry.getValue()[i]
                        : valueStr + entry.getValue()[i] + ",";
            }
            //乱码解决，这段代码在出现乱码时使用。如果mysign和sign不相等也可以使用这段代码转化
            //valueStr = new String(valueStr.getBytes("ISO-8859-1"), "gbk");
            params.put(entry.getKey(), valueStr);
        }
        log.info("{}通知请求数据:reqStr={}", logPrefix, params);
        if(params.isEmpty()) {
            log.error("{}请求参数为空", logPrefix);
            return PayConstant.RETURN_ALIPAY_VALUE_FAIL;
        }
        return paymentNoticeService.handlePayCallBackNotify(PayConstant.PAY_CHANNEL_ALIPAY,params);
    }
}
*/
